package cn.wolfcode.rbac.mapper.system_manage;

import cn.wolfcode.rbac.domain.Role;
import cn.wolfcode.rbac.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    /**
     * 分页方法
     * @Author Cao Zhijian
     * @Creed: Talk is cheap,show me the code
     * @Created: 2020/12/25 0025 10:00
     * @param queryObject :
     * @return : java.util.List<cn.wolfcode.rbac.domain.Department>
     */
    List<Role> selectForList(QueryObject queryObject);

    /**
     * 查询数据库中有多少条数据
     * @Author Cao Zhijian
     * @Creed: Talk is cheap,show me the code
     * @Created: 2020/12/25 0025 10:01
     * @return : int
     */
    int selectForCount();

    void insertRoleAndPermissionRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    void deleteRoleAndPermissionRelation(Long id);
}